<template>
	<view class="etailedArticle">
		<view class="etailedArticle-cen">
			<!-- <rich-text :nodes="setData" /> -->
			<u-parse :content="centent" @preview="preview" @navigate="navigate" />
		</view>
	</view>
</template>

<script>
	// import parse from 'mini-html-parser2';
	import uParse from '@/components/gaoyia-parse/parse.vue'
	export default {
		data() {
			return {
				title:'',
				centent:'',
				setData:[],
			};
		},
		onLoad(e) {
			this.title = e.data
			// this.title = '押金介绍'
			setTimeout(() => {
				uni.setNavigationBarTitle({
					title: this.title
				});
			}, 200)
			this.init()
		},
		components:{
			uParse
		},
		methods:{
			preview(src, e) {
				// do something
			},
			navigate(href, e) {
				// do something
			},
			init(){
				console.log(this.title,'pppp');
				this.$request("Login/ConfigList", {
					data: {
						
					},
					isLoad: false
				}).then(res => {
					
					let arr = []
					arr = res.result.filter(item=>{
						return item.name === this.title
					})
					let richtext = arr[0].value
					let fileServerIp = 'https://www.kmdj2018.com'
					this.centent = richtext.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, p1){
					   return `<img src='${p1.includes(fileServerIp)? p1 : 'https://images.weserv.nl/?url=' + p1}' />`
					})
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.etailedArticle{
		background-color: #fff;
		height: 100vh;
		padding: 20rpx 32rpx;
	}
	.etailedArticle-cen{
		  word-break:break-all;
		  word-wrap:break-word
	}
</style>
